<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>人员管理</title> 
<link href="/assets/background/css/base.css" rel="stylesheet">
<link href="/assets/background/css/backend/person_manger.css" rel="stylesheet">
<script type="text/javascript" src="/assets/background/js/jquery.js"></script>
<script type="text/javascript">

	$(document).ready(function(){
		$(".query").click(function(){
			var nickName = $("#nickName").val();
			var url = "/seller/relenisment/getuser";
			$.post(
					url,
					{key:nickName},
					function(data){
						$("#userTbody").html("");
						for(var i=0;i<data.length;i++){
							$("#userTbody").append("<tr>"+
									"<td class='grid-checkbox'><input type='checkbox'></td>"+
									"<td class='num'>"+i+"</td>"+
									"<td><img src='"+data[i].uPhoto+"' width='50px' height='50px'></td>"+
									"<td>"+data[i].uName+"</td>"+
									"<td>"+data[i].uSex+"</td>"+
									"<td>"+data[i].openId+"</td>"+
									"<td><input type='button' value='添加' onclick=add('"+data[i].id+"')></td>"+
								"</tr>");
						}
						//alert(data);
					});
		});
		
	});

	
	function add(userid){
		var url = "/seller/relenisment/add";
		$.post(
				url,
				{id:userid},
					function(data){
						alert(data);
					}
				);
		
		
	}
</script>
</head> 

<body>
    <div class="container">
        <div id="inner-hd">
            <div class="crumbs">
				<i class="crumbs-arrow"></i>
				<a href="javascript:;" class="crumbs-label">添加补货员</a>
			</div>
        </div>

        <div id="inner-bd">
        	<div class="tab-wraper">
        	</div>
            


            <div class="kv-group-outer">
		        <div class="kv-group clearfix">
			    
		        </div>
		    </div>

            <div class="button-group">
		       <div class="button current" onclick="history.go(-1)">
		            <i class="iconfont"><</i>
		            <span class="button-label">返回</span>
		        </div>
		    </div>
			
		<div class="add-manage">
			<table class="kv-table">
				<tbody>
					<tr>
						<td class="kv-label">
							微信昵称：
						</td>
						<td class="kv-content" style="padding: 10px;width: 80%;">
							<input id="nickName" type="text" Style="width: 20%;" value="">
							<div class="button-group">
						        <div class="button current query">
						            <i class="iconfont">&#xe625;</i>
						            <span class="button-label">查询</span>
						      	 </div>
		    				</div>
						</td>
				</tbody>
			</table>
			
			<table class="grid">
				<colgroup>
					<col width="50"></col>
					<col width="70"></col>
					<col width="200"></col>
					<col width="200"></col>
					<col width="140"></col>
					<col width="*"></col>
					<col width="120"></col>
				</colgroup>
				<thead>
					<tr>
						<th class="grid-checkbox"><input type="checkbox"></th>
						<th class="num">序号</th>
						<th>头像</th>
						<th>昵称</th>
						<th>性别</th>
						<th>openid</th>
						<th>操作</th>
					</tr>
				</thead>
				
				<tbody id="userTbody">
				</tbody>
			</table>
			
		</div>
			
        </div>

    </div>

</body> 
</html>
